package com.study.config;

//这个文件是处理403的手动处理写法，如果“SecurityConfiguration3”文件的54行代码没启用，那么这里可以全部删掉

//@Component
//public class MyAccessDeniedHandle implements AccessDeniedHandler {
//    @Override
//    public void handle(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse, AccessDeniedException e) throws IOException, ServletException {
//        httpServletResponse.setStatus(HttpServletResponse.SC_FORBIDDEN); // 设置返回状态为403
//        httpServletResponse.setHeader("Content-Type","application/json;charset=utf-8");
//        PrintWriter out = httpServletResponse.getWriter();
//        out.write("{\"status\":\"error\",\"msg\":\"权限不足，请联系管理员!\"}");
//        out.flush();
//        out.close();
//    }
//}
